<template>
  <div style="width: 100%">
    <el-main style="height: 100%; padding: 10px 0px">
      <el-table
        :data="tableData"
        border
        :header-cell-style="{
          textAlign: 'center',
          height: '40px',
        }"
        :row-style="{ height: '60px' }"
      >
        <el-table-column prop="id" label="员工号"></el-table-column>
        <el-table-column prop="name" label="姓名"></el-table-column>
        <el-table-column prop="year" label="年"></el-table-column>
        <el-table-column prop="month" label="月"></el-table-column>
        <el-table-column prop="clockDay" label="已考勤天数"> </el-table-column>
      </el-table>
      <div class="block">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="pageNum"
          :page-sizes="[5, 10, 15, 20]"
          :page-size="pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
    </el-main>
  </div>
</template>
  
  <script>
export default {
  data() {
    return {
      tableData: [],
      total: 0,
      pageNum: 1,
      pageSize: 10,
      id: "",
      makeTime: "",
      dialogFormVisible: false,
      adminFrom: {},
    };
  },
  methods: {
    load() {
      this.request
        .get("/Acceptability/Page", {
          params: {
            pageNum: this.pageNum,
            pageSize: this.pageSize,
            id: this.id,
            makeTime: this.makeTime,
          },
        })
        .then((req) => {
          this.tableData = req.records;
          this.total = req.total;
          console.log(this.tableData);
        });
    },
    handleSizeChange(pageSize) {
      this.pageSize = pageSize;
      this.load();
    },
    handleCurrentChange(pageNum) {
      this.pageNum = pageNum;
      this.load();
    },
  },
  created() {
    this.load();
  },
};
</script>
  
  <style>
</style>